<template>
  <div class="story-page">
    <div class="screen-header">
      <div class="header-title">
        <h1>家传轶事</h1>
        <p>分享您的家族故事，传承中华文化</p>
      </div>
      <div class="header-time">
        {{ currentTime }}
      </div>
    </div>
    <div class="screen-body">
      <StoryBoard />
    </div>
  </div>
</template>

<script>
import StoryBoard from '@/components/story/StoryBoard.vue'

export default {
  name: 'StoryPage',
  components: {
    StoryBoard
  },
  data () {
    return {
      currentTime: ''
    }
  },
  mounted () {
    this.updateTime()
    setInterval(this.updateTime, 1000)
  },
  methods: {
    updateTime () {
      const now = new Date()
      this.currentTime = now.toLocaleString('zh-CN', {
        year: 'numeric',
        month: '2-digit',
        day: '2-digit',
        hour: '2-digit',
        minute: '2-digit',
        second: '2-digit',
        hour12: false
      })
    }
  }
}
</script>

<style scoped>
.story-page {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, #f5f5f5 0%, #e8d5c4 100%);
  padding: 20px;
}

.screen-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.header-title h1 {
  font-size: 28px;
  color: #4A2F1D;
  margin: 0;
  font-weight: bold;
}

.header-title p {
  font-size: 16px;
  color: #666;
  margin: 10px 0 0;
}

.header-time {
  font-size: 16px;
  color: #4A2F1D;
  font-weight: bold;
}

.screen-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow: hidden;
}
</style>
